/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class ListBdcombustibleData {
	private static final int ROW_COUNT = 100;
	
public void listTestData() throws PersistentException {
		orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
		System.out.println("Listing Tp_log...");
		orm.Tp_log[] ormTp_logs = lDAOFactory.getTp_logDAO().listTp_logByQuery(null, null);
		int length = Math.min(ormTp_logs.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(ormTp_logs[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
	}
	
	public void listByCriteria() throws PersistentException  {
		System.out.println("Listing Tp_log by Criteria...");
		orm.Tp_logCriteria tp_logCriteria = new orm.Tp_logCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//tp_logCriteria.l_id.eq();
		tp_logCriteria.setMaxResults(ROW_COUNT);
		orm.Tp_log[] ormTp_logs = tp_logCriteria.listTp_log();
		int length =ormTp_logs== null ? 0 : Math.min(ormTp_logs.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(ormTp_logs[i]);
		}
		System.out.println(length + " Tp_log record(s) retrieved."); 
		
	}
	
	public static void main(String[] args) {
		try {
			ListBdcombustibleData listBdcombustibleData = new ListBdcombustibleData();
			try {
				listBdcombustibleData.listTestData();
				//listBdcombustibleData.listByCriteria();
			}
			finally {
				orm.Bdprueba2PdsPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
